﻿@model Forum.Web.Models.TopicListModel
@using Forum.Web.BaseCode
@using Frame.Lib.Web
@using Forum.Entity.Post
@{
    ViewBag.Title = "List";
    Layout = "~/Views/Shared/Main.cshtml";
}
@section head
{
    @Html.Raw(ForumStyle.List)
    @Html.Raw(ForumStyle.Pager)

    <script type="text/javascript">
        function postTopic()
        {
            window.location.href = '@(ForumPath.VirtualRoot+"topic/add/" + Model.BoardInfo.ID )';
        }

        function cchk_click()
        {
            $("#cchk").toggleClass("chked");
        }
    </script>
}
<div class="nav">
    <a href="#" class="img">
        <img src="@(ForumPath.Image + "pt_icn.png")" alt="" /></a><a href='@ForumPath.VirtualRoot' class="space">论坛</a><a
            href="#" class="space">@Model.BoardInfo.Name</a>
    <div class="but">
        <a href="#">搜索本版</a><input type="text" class="text" /><input type="button" class="button"
            value="搜索" /></div>
    <div class="clear">
    </div>
</div>
<div class="List_top">
    <div class="top">
        <div class="left">
            <a href="#">银光茶馆</a>今日: <span>51</span>|主题: <span>377</span></div>
        <div class="right">
            <a href="#" class="bb">收藏本版</a><a href="#" class="dy">订阅</a></div>
    </div>
    <div class="clear">
    </div>
    <div class="bot">
        版主: <a href="javascript:;">@Model.BoardInfo.Moderator</a></div>
</div>
<div class="List_page">
    <div class="left">
        <input type="button" style="cursor:pointer;" onclick="postTopic()" /></div>
    @Html.Raw(HtmlPager.Render(Model.Pager, Model.UrlPrefix, true))
    <div class="right">
        <a href='@ForumPath.VirtualRoot' class="spage">返回首页</a>
    </div>
</div>
@if (this.Model.BoardInfo.Types.Count > 1)
{
    <ul class="topic_type" style="">
        @foreach (var type in this.Model.BoardInfo.Types)
        {
            <li>
                <a href='@(ForumPath.VirtualRoot + "topic/list/" + Model.BoardInfo.ID + "?TypeID=" + type.ID)' @if(type.ID == this.Model.TopicTypeID){ @Html.Raw("class='on'") }> @type.Name</a>
            </li>
        }
        <li style="clear:both;"></li>
    </ul>
}
<div class="List_main">
    <div class="List_main_tit">
        <span class="left">筛选: <a href="#'">全部主题</a> <a href="#'">全部时间</a> |排序: <a href="#'">
            最后发表</a> |<a href="#'">精华</a>
     
            </span>
        <span id="cchk" onclick="cchk_click()">新窗</span>
        <span class="mid">作者</span>
        <span class="middle">回复/查看 </span>
        <span class="right">最后发表</span>
    </div>
    <div class="clear">
    </div>
    <div class="List_main_con">
        <ul>
            @foreach (ForumTopicInfo info in this.Model.TopList)
            {
                <li><span class="left"><a href='@(ForumPath.VirtualRoot + "topic/Detail/" + info.ID)'
                    title="全局置顶主题 - 新窗口打开" target="_blank">
                    @if (info.TopLevel == (int)ForumTopicTopLevel.Board)
                    { 
                        <img src="@(ForumPath.Image + "pin_1.gif")" alt="本版置顶" />
                    }
                    else
                    {
                        <img src="@(ForumPath.Image + "pin_3.gif")" alt="全局置顶" />
                    }
                </a><a href='@(ForumPath.VirtualRoot + "topic/detail/" + info.ID)' class="que">
                    @info.Name
                </a></span><span class="mid"><a href="javascript:;" class="black">
                    @info.MemberName</a>@info.InputTime.ToString("yyyy-MM-dd")</span> <span class="middle">
                        <a href="@(ForumPath.VirtualRoot + "topic/detail/" + info.ID)">
                            @info.ReplyCount</a>@info.ViewCount</span> <span class="right"><a href="javascript:;"
                                class="black">
                                @info.LastPosterName</a><a href="javascript:;">@info.LastPostTime </a>
                    </span></li>
            }
            <li class="zt">版块主题</li>
            @foreach (ForumTopicInfo info in this.Model.NormalList)
            { 
                <li><span class="left">
                    <img src="@(ForumPath.Image + "folder_new.gif")" />
                    @if (info.TypeID != 0)
                    { 
                        <em>[<a href="javascript:;">@info.TypeName</a>]</em>
                    }
                    <a href="@(ForumPath.VirtualRoot + "topic/Detail/" + info.ID)">
                        @info.Name </a></span><span class="mid"><a href="javascript:;" class="black">
                            @info.MemberName </a>@info.InputTime.ToString("yyyy-MM-dd")</span> <span class="middle">
                                <a href="@(ForumPath.VirtualRoot + "topic/detail/" + info.ID)">
                                    @info.ReplyCount</a>@info.ViewCount</span> <span class="right"><a href="javascript:;"
                                        class="black">
                                        @info.LastPosterName</a><a href="javascript:;">@info.LastPostTime</a></span>
                </li>
            }
        </ul>
    </div>
    <div class="clear">
    </div>
</div>
<div class="List_page">
    <div class="left">
        <input type="button" /></div>
    @Html.Raw(HtmlPager.Render(Model.Pager, Model.UrlPrefix, true))
    <div class="right">
        <a href='@ForumPath.VirtualRoot' class="spage">返回首页</a>
    </div>
    <div class="clear">
    </div>
</div>

